package com.zhangtai.modules.service.insurance;

import com.zhangtai.modules.dto.InsuranceDto;
import com.zhangtai.modules.entity.insurance.InsuranceEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-11-23 14:28:02
 */

public interface InsuranceService {

    @GetMapping("/findInsuranceList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    List<InsuranceEntity> getAllInsuranceList();

    PageResult<InsuranceDto> getInsuranceList(@RequestParam(value = "companyId", required = false) Long companyId,
                                              @RequestParam(value = "insuranceUnit", required = false) String insuranceUnit,
                                              @RequestParam(value = "status", required = false) Integer status,
                                              @RequestParam(value = "startTime", required = false) String startTime,
                                              @RequestParam(value = "endTime", required = false) String endTime,
                                              @RequestParam(value = "number", required = false) Integer number,
                                              @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/infoInsurance")
    @ApiOperation(value = "根据id查找")
    InsuranceEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveInsurance")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody InsuranceEntity entity);

    @PostMapping("/updateInsurance")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody InsuranceEntity entity);

    @GetMapping("/deleteOneInsurance")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    R unValidOne(Long id );

    @PostMapping("/deleteInsurances")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

